package com.bsoft.gol.editor.editor;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by ChenJij on 2021/10/11.
 */
@Entity
@Table(name = "editor_questionnaire_title_collection")
public class EditorQuestionnaireTitleCollection {
    private String collectionId;
    private String collectorId;
    private String titleId;
    private String titleName;
    private int sort;
    private Date createTime;
    private String createUserId;

    @Id
    @Column(name = "collection_id")
    public String getCollectionId() {
        return collectionId;
    }

    public void setCollectionId(String collectionId) {
        this.collectionId = collectionId;
    }

    @Basic
    @Column(name = "collector_id")
    public String getCollectorId() {
        return collectorId;
    }

    public void setCollectorId(String collectorId) {
        this.collectorId = collectorId;
    }

    @Basic
    @Column(name = "title_id")
    public String getTitleId() {
        return titleId;
    }

    public void setTitleId(String titleId) {
        this.titleId = titleId;
    }

    @Basic
    @Column(name = "title_name")
    public String getTitleName() {
        return titleName;
    }

    public void setTitleName(String titleName) {
        this.titleName = titleName;
    }

    @Basic
    @Column(name = "sort")
    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "create_user_id")
    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        EditorQuestionnaireTitleCollection that = (EditorQuestionnaireTitleCollection) o;

        if (sort != that.sort) return false;
        if (collectionId != null ? !collectionId.equals(that.collectionId) : that.collectionId != null) return false;
        if (collectorId != null ? !collectorId.equals(that.collectorId) : that.collectorId != null) return false;
        if (titleId != null ? !titleId.equals(that.titleId) : that.titleId != null) return false;
        if (titleName != null ? !titleName.equals(that.titleName) : that.titleName != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (createUserId != null ? !createUserId.equals(that.createUserId) : that.createUserId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = collectionId != null ? collectionId.hashCode() : 0;
        result = 31 * result + (collectorId != null ? collectorId.hashCode() : 0);
        result = 31 * result + (titleId != null ? titleId.hashCode() : 0);
        result = 31 * result + (titleName != null ? titleName.hashCode() : 0);
        result = 31 * result + sort;
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (createUserId != null ? createUserId.hashCode() : 0);
        return result;
    }
}